#ifndef _CREATEREGIONACTION_
#define _CREATEREGIONACTION_

#include "BaseAction.hpp"
#include "../EditorRegionManager.hpp"
#include "../EditorRegion.hpp"
#include "../UI/RegionPanel.hpp"

/**
 * Create a new region.
 */
class CreateRegionAction:public BaseAction{
protected:
    struct RegionInfo{
        int x;
        int y;
        int w;
        int h;
        int i;
    };

    RegionInfo region;
    
    EditorRegionManager* manager;
    RegionPanel* regionPanel;
public:
    /** Region created by Action. */
    Region* createdRegion;

    CreateRegionAction(EditorRegionManager* regionManager, RegionPanel* panel, int x, int y, int w, int h);
    
    virtual void perform();
    virtual void undo();
};

#endif